package com.xuexi.api;

import com.easygo.utils.PageUtils;
import com.xuexi.easygo.pojo.Brand;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "easygo-brand-service")
    public interface BrandClient {

    @RequestMapping("/brand_getBrands")
    List<Brand> getBrands();

    @RequestMapping("brand_add")
    int addBrand(@RequestBody Brand brand);

    @RequestMapping("brand_getBrandById")
     Brand getBrandById(@RequestParam(value = "id") Integer id);

    @RequestMapping("brand_updateBrand")
    int updateBrand(@RequestBody Brand brand);

    @RequestMapping("brand_delete")
    int deleteBrand(@RequestParam(value = "id") Integer id);

    @RequestMapping("brands_deleteSome")
    int deleteSome(@RequestParam(value = "ids") String ids);

    @RequestMapping("brand_page")
     PageUtils getBrandsByPage(@RequestParam(defaultValue = "1",required = false,value = "pageIndex") Integer pageIndex,
                                     @RequestParam(defaultValue = "5",required = false,value = "pageSize") Integer pageSize);

}
